<template lang="html">
  <div class="relate2">
    <ul class="relateWrap2">
      <li v-for="(item,index) in datas">
        <div class="cantuan">
          <img :src="item.imgurl" alt="">
          <p>参团游</p>
          <p>{{item.departure_name}}</p>
        </div>
        <p>{{item.title}}</p>
        <div class="four2">
          <i v-for="(i,id) in item.label" v-if="id<4">{{i}}</i>
        </div>
        <p class="mouthM2"><span>{{item.trip_date}}</span><strong>￥{{item.teamprices}}起</strong></p>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data(){
    return{
      datas:{}
    }
  },
  created(){
    this.axios.get('http://txspring.cn:8080/getRelated').then(data=>{
      console.log(data.data.data);
      this.datas = data.data.data;

    })
  }
}
</script>

<style lang="css">
.relate2{
  text-align: left;
}
.relateWrap2{
  width: 99%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  margin-left: 1.9%;
}
.relateWrap2 li{
  width: 48%;
  padding: 0.5rem;
}
.relateWrap2 li:nth-of-type(2n){
  padding-right: 0;
}
.relateWrap2>li:first-child{
  border-right: #edeced solid 1px;
  border-bottom: #edeced solid 1px;
}
.relateWrap2>li:last-child{
  border-top: #edeced solid 1px;
  border-left: #edeced solid 1px;
}
.cantuan{
  position: relative;
  font-size: 0;
  overflow: hidden;
}
.cantuan>img{
  height: 12rem;
}
.cantuan>img{
  width: 100%;
}
.cantuan>p{
  font-size: 1.5rem;
  color: #fff;
}
.cantuan>p:nth-of-type(1){
  background: #00b0ec;
  padding: 0.2rem 1rem;
  position: absolute;
  top: 1.5rem;
}
.cantuan>p:nth-of-type(2){
  width: 100%;
  background: rgba(0,0,0,0.8);
  position: absolute;
  bottom: 0rem;
  padding: 0.5rem 0 0.5rem 0.5rem;
}
.relateWrap2>li>p{
  font-size: 1.5rem;
  margin: 1.5rem 0 1.5rem 0.5rem;
}
.relateWrap2>li>p:nth-of-type(1){
  text-overflow: -o-ellipsis-lastline;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.four2>i{
  padding: 0.1rem;
  text-align: center;
  color: #0099a9;
  border: #0099a9 solid 1px;
  margin-left: 0.5rem;
}
.mouthM2{
  display: flex;
  justify-content: space-between;
}
.mouthM2>span{
  color: #999;
  font-size: 1.3rem;
  line-height: 2rem;
}
.mouthM2>strong{
  color: #ff6b01;
  font-size: 2rem;
}
</style>
